Fix rake task helpers polluting global namespace#91
Fix rake task helpers polluting global namespace#91hibachrach wants to merge 2 commits intographiti-api:mainfrom
Conversation
Before, the `session` method (for example) would be redefined in the context of an RSpec request spec because the default definee in the block within the `namespace` call would be `main`, the global object. Additional context about default definees: https://blog.yugui.jp/entry/846
|
Another option is to define the methods in an external file/module, and only require them from within the task defs. That way they're only included when those tasks are actually run. |
|
Would you prefer that option? Willing to edit the PR if that's the case. |
|
@hibachrach I'm not one of the maintainers, so I can't speak for them or the project. However, moving the module(s) into an external file that is explicitly (and only) required when needed is the approach I use and recommend on my teams. As it stands in this PR, the What's more, then you can |
|
^ I agree with @jasonkarns |
Before, the
sessionmethod (for example) would be redefined in thecontext of an RSpec request spec because the default definee in the
block within the
namespacecall would bemain, the global object.Additional context about default definees:
https://blog.yugui.jp/entry/846